<!--
  @author heguanghua
  @since 2019/06/12 19:34
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<table class="layui-hide" id="zmn-table" lay-filter="zmn-table" th:fragment="table">
    <thead>
    <tr>
        <th lay-data="{type:'checkbox', width:50, unresize:true, align:'center', fixed:'left'}"></th>
        <th lay-data="{field:'sort', width:60, unresize:true, sort:true, align:'center', edit:'text', fixed:'left'}">排序</th>
        <th lay-data="{field:'productId', width:60, unresize:true, align:'center', fixed:'left'}">产品ID</th>
        <th lay-data="{field:'name', minWidth:200, unresize:false, align:'left', fixed:'left'}">产品名称</th>
        <th lay-data="{field:'showProductName', minWidth:160, unresize:false, align:'left'}">前台产品名称</th>
        <th lay-data="{field:'servCategName', width:100, unresize:false, align:'center'}">服务分类</th>
        <th lay-data="{field:'categOneName', width:100, unresize:false, align:'center'}">一级分类</th>
        <th lay-data="{field:'categName', width:100,unresize:false, align:'center'}">二级分类</th>
        <th lay-data="{field:'bizTypeStr', width:230, unresize:false, align:'left'}">业务类型</th>
        <th lay-data="{field:'productType', width:90, unresize:true, align:'center'}">产品类型</th>
        <th lay-data="{field:'channelName', width:90, unresize:true, align:'center'}">渠道名称</th>
        <th lay-data="{field:'unit', width:50, unresize:true, align:'left'}">单位</th>
        <th lay-data="{field:'status', width:70, unresize:true, align:'center'}">状态</th>
        <th lay-data="{field:'tariffName', width:80, unresize:false, align:'center'}">计价器名称</th>
        <th lay-data="{field:'totalEmissions', width:100, unresize:false, align:'center'}">排放量（g）</th>
        <th lay-data="{field:'tariffStatus', width:100, unresize:false, align:'center'}">计价器状态</th>
        <th lay-data="{field:'updateTime', width:190, unresize:true, align:'center'}">最近修改人/时间</th>
        <th lay-data="{field:'操作',width:180, unresize:true, align:'center', fixed:'right'}">操作</th>
    </tr>
    </thead>

    <tbody>
    <tr th:each="item:${items}">
        <td></td>
        <td th:text="${item.sort}">sort</td>
        <td th:text="${item.productId}" class="">productId</td>
        <td th:text="${item.name}" class="layui-gray">name</td>
        <td th:text="${item.showProductName}" class="layui-gray">showProductName</td>
        <td th:text="${item.servCategName}" class="layui-gray">servCategName</td>
        <td th:text="${item.categOneName}" class="layui-gray">categOneName</td>
        <td th:text="${item.categName}" class="layui-gray">categName</td>
        <td th:text="${item.bizTypeStr}" class="layui-gray">bizTypeStr</td>
        <td th:text="${item.productType == 1 ? '通用产品' : '渠道产品'}">outsideUse</td>
        <td th:text="${item.productType == 1 ? '-' : item.channelName}">channelName</td>
        <td th:text="${item.unit}">unit</td>
        <td>
            <div th:onmouseover="|show_tips(${(#authPermit.checkPermit('/product/updateStatus.action'))},'请先开启“上架/下架”的权限',this)|">
                <input th:disabled="${(#authPermit.checkPermit('/product/updateStatus.action'))?'false':'true'}" type="checkbox" name="status" id="status" th:key="${item.productId}" th:value="${item.status}"
                       lay-text="ON|OFF" lay-skin="switch" lay-filter="chk_show_status" th:checked="${item.status == 2}"/>
            </div>
        </td>
        <td th:text="${item.tariffName}">tariffName</td>
        <td>
            <div style="text-align: right">
            [[${#numbers.formatDecimal(item.totalEmissions,1,'COMMA',0,'POINT')}]]
            </div>
        </td>
        <td th:text="${item.tariffStatus==2?'启用':'停用'}">tariffStatus</td>
        <td th:text="${(item.updater != null ? item.updater+'/' : '')+T(com.zmn.common.utils.date.DateUtil).toString(item.updateTime)}">updateTime</td>
        <td>
            <div>
                <a th:if="${#authPermit.checkPermit('/product/addEditView.action')}" lay-text="详情" style="color: #00a0e9"
                   th:lay-href="|/product/addEditView.action?productId=${item.productId}|">详情</a>
                <a th:if="${#authPermit.checkPermit('/product/addEditView.action')}" lay-text="产品价格表" style="color: #00a0e9"
                   th:lay-href="|/product/price/listProductPrice.action?itemType=2&productId=${item.productId}|">产品价格表</a>
                <a th:if="${#authPermit.checkPermit('/product/updateTotalEmissions.action')}" lay-text="排放设置" style="color: #00a0e9"
                   th:onclick="updateTotalEmissions([[${item.productId}]])" href="#">排放设置</a>
            </div>
        </td>
    </tr>
    </tbody>
</table>
